package com.zjlp.seproject.mapper;

import com.zjlp.seproject.pojo.Profile;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

@Mapper
public interface ProfileMapper {
    @Update("update profile set company = #{company}, experience = #{experience}, profile =  #{profile}, email = #{email}" +
            "where uid = #{uid}")
    Integer setProfile(Profile profile);

    @Select("select * from profile where uid = #{uid}")
    Profile getProfile(Integer uid);

    @Update("insert into profile(uid, company, experience, profile, email) values" +
            "(#{id}, 无, 无, 无, 无)")
    Integer init(Integer id);

    @Select("select profile from profile where uid = #{uid}")
    String profile(Integer uid);
}
